package com.poorstu.web.studentApply;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.common.base.web.BaseAction;
import com.poorstu.manager.StudentManager;
import com.poorstu.model.UserPartTimeMod;

public class MyApplyPartTimeAction extends BaseAction {

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		try{
		int allUserId=(Integer)request.getSession().getAttribute("allUserId");
		
		//int allUserId=1;// 手动设置的alluserid 应该从 session里面拿到 
		StudentManager stuManager=(StudentManager)getBean("studentManager");
		List<UserPartTimeMod> userPartTime=new  ArrayList<UserPartTimeMod>();
		userPartTime=stuManager.selectMyApplyPartTime(allUserId);
		request.setAttribute("userPartTime", userPartTime);
		return mapping.findForward("succ");
		}catch(Exception e){
			e.printStackTrace();
			return mapping.findForward("failure");
		}
	}
	
	

}
